package com.leet.code.lcof;

public class Code10_2 {

    public static void main(String[] args) {
        System.out.println(numWays(2));
    }

    public static int numWays(int n) {
        int a0 = 0;
        int a1 = 1;
        if (n == 0) {
            return  1;
        }

        int an = 0;
        for (int i = 1; i <= n; i++) {
            an = (a1 + a0) % 1000000007;
            a0 = a1 ;
            a1 = an ;
        }
        return an;
    }

}
